/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ${USER}
 * Date: ${YEAR}-${MONTH}-${DAY}
 * Time: ${TIME}
 */
import java.util.*;
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
class Main2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        String s2 = str.toUpperCase();
        StringBuffer sb = new StringBuffer();
        for(int i = 0; i < s2.length(); i++) {
            char ch = s2.charAt(i);
            if(i == 0) sb.append(ch);
            if(i - 1 >= 0 && s2.charAt(i - 1) == ' ') {
                sb.append(ch);
            }
        }
        System.out.println(sb.toString());
    }
}
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        long[] arr = new long[n];
        for(int i = 0; i < n; i++) {
            arr[i] = in.nextLong();
        }
        PriorityQueue<Long> queue = new PriorityQueue<>((o1, o2) -> o2.compareTo(o1));
        for(long x : arr) {
            if(x % 2 == 0) queue.offer(x);
        }
        ArrayList<Long> list = new ArrayList<>();
        while(k != 0 && !queue.isEmpty()) {
            long val = queue.poll();
            long x = val / 2;
            if(x % 2 == 0) queue.offer(x);
            else list.add(x);
            k--;
        }
        long sum = 0;
        for(int i = 0; i < n; i++) {
            if(arr[i] % 2 != 0) sum += arr[i];
        }
        if(!queue.isEmpty()) for(long x : queue) sum += x;
        for(long x : list) sum += x;
        System.out.print(sum);
    }

    // 注意类名必须为 Main, 不要有任何 package xxx 信息
    class Main3 {
        static int ret[];
        static int prev;
        public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            int n = in.nextInt();
            int x = in.nextInt();
            int[] a = new int[n + 1];
            for (int i = 1 ; i <= n; i++) {
                a[i] = in.nextInt();
            }
            ret = new int[2];
            prev = 0;
            int[] dp = new int[n + 1];
            for (int i = 1; i <= n; i++) {
                dp[i] = dp[i - 1] + a[i];
                while (dp[i] - dp[prev] >= x && prev < i) {
                    if(ret[0] == 0) {
                        ret[0] = prev + 1;
                        ret[1] = i;
                    }else if(ret[1] - ret[0] > i - (prev + 1)) {
                        ret[0] = prev + 1;
                        ret[1] = i;
                    }
                    prev++;
                }
            }
            System.out.print(ret[0] + " " + ret[1]);
        }
    }











}